--[[
	Ikarus Unit-Frames Addon	
	released under GNU General Public License version 3 (GPLv3) 
	by McGaerty & Sl4ker
	
	contact: mcgaerty@ikarus-systems.net rom@sl4ker.de	
	download: http://rom.curse.com/downloads/rom-addons/details/ikarus-unitframes.aspx
	
	special thanks to Qwox and novayuna for inspiration and stable basics
]]



do

ikarus.config.defaults.targettarget = {
	["GENERAL"] = {
		["VISIBLE"] = true,
		["FRAME"] = "Ikarus_TargetTargetFrame",
		["DEFAULT_FRAME"] = "TargetTargetFrame",
		["WOW_STYLE"] = false,
		["USE_DEFAULT_FRAME"] = true,
		["OFFSET_X"] = 55,
		["OFFSET_Y"] = 75,
		["WIDTH"] = 200,
		["HEIGHT"] = 50,
		["ALPHA"] = 1.0,
		["NUMBER_FORMAT"] = "UNFORMATTED",
		["FRAME_LOCKED"] = false,
		["SCALE"] = 0.7
	},
	
	["DOCKING"] = {
		["ENABLE"] = true,
		["TARGET"] = "TARGET",
		["OFFSET_X"] = 30,
		["OFFSET_Y"] = 20,
		["ALIGNMENT"] = "BOTTOM"
	},
	
	["HEALTHBAR"] = {
		["VISIBLE"] = true,
		["FRAME"] = "Ikarus_TargetTargetFrameHealthBar",
		["CLASS_COLOR"] = false,
		["WEIGHT"] = 60,
		["TEXTURE"] = "Healbot",
		["COLORIZER"] = "NONE",
		["FOREGROUND_COLOR"] = { r = 1.0, g = 0.04, b = 0.02 },
		["BACKGROUND_COLOR"] = { r = 0.2, g = 0.4, b = 0.65 },
		
		["LEFTTEXT_VISIBLE"] = true,
		["LEFTTEXT_FRAME"] = "Ikarus_TargetTargetFrameHealthBarLeftText",
		["LEFTTEXT_OFFSET_X"] = 50,
		["LEFTTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["LEFTTEXT_FONT"] = "Default",
		["LEFTTEXT_FONTSIZE"] = 10,
		["LEFTTEXT_COLORIZER"] = "NONE",
		["LEFTTEXT_CONTENT"] = "[HEALTH]",
		
		["RIGHTTEXT_VISIBLE"] = false,
		["RIGHTTEXT_FRAME"] = "Ikarus_TargetTargetFrameHealthBarRightText",
		["RIGHTTEXT_OFFSET_X"] = 1,
		["RIGHTTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["RIGHTTEXT_FONT"] = "Default",
		["RIGHTTEXT_FONTSIZE"] = 10,
		["RIGHTTEXT_COLORIZER"] = "NONE",
		["RIGHTTEXT_CONTENT"] = "",
		
		["OUTSIDE_LEFTTEXT_VISIBLE"] = false,
		["OUTSIDE_LEFTTEXT_FRAME"] = "Ikarus_TargetTargetFrameHealthBarOutsideLeftText",
		["OUTSIDE_LEFTTEXT_OFFSET_X"] = 1,
		["OUTSIDE_LEFTTEXT_TEXTCOLOR"] = { r = 0.3, g = 0.5, b = 0.85 },
		["OUTSIDE_LEFTTEXT_FONT"] = "Default",
		["OUTSIDE_LEFTTEXT_FONTSIZE"] = 10,
		["OUTSIDE_LEFTTEXT_COLORIZER"] = "NONE",
		["OUTSIDE_LEFTTEXT_CONTENT"] = "",
		
		["OUTSIDE_RIGHTTEXT_VISIBLE"] = false,
		["OUTSIDE_RIGHTTEXT_FRAME"] = "Ikarus_TargetTargetFrameHealthBarOutsideRightText",
		["OUTSIDE_RIGHTTEXT_OFFSET_X"] = 1,
		["OUTSIDE_RIGHTTEXT_TEXTCOLOR"] = { r = 0.3, g = 0.5, b = 0.85 },
		["OUTSIDE_RIGHTTEXT_FONT"] = "Default",
		["OUTSIDE_RIGHTTEXT_FONTSIZE"] = 10,
		["OUTSIDE_RIGHTTEXT_COLORIZER"] = "NONE",
		["OUTSIDE_RIGHTTEXT_CONTENT"] = ""
	},
	
	["MANABAR"] = {
		["VISIBLE"] = true,
		["FRAME"] = "Ikarus_TargetTargetFrameManaBar",
		["SYSTEM_COLOR"] = false,
		["OFFSET_X"] = 1,
		["OFFSET_Y"] = 1,
		["WEIGHT"] = 25,
		["TEXTURE"] = "Healbot",
		["COLORIZER"] = "NONE",
		["FOREGROUND_COLOR"] = { r = 0.3, g = 0.5, b = 0.85 },
		["BACKGROUND_COLOR"] = { r = 0.2, g = 0.4, b = 0.65 },
		
		["LEFTTEXT_VISIBLE"] = true,
		["LEFTTEXT_FRAME"] = "Ikarus_TargetTargetFrameManaBarLeftText",
		["LEFTTEXT_OFFSET_X"] = 100,
		["LEFTTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["LEFTTEXT_FONT"] = "Default",
		["LEFTTEXT_FONTSIZE"] = 10,
		["LEFTTEXT_COLORIZER"] = "NONE",
		["LEFTTEXT_CONTENT"] = "[MP]",
		
		["RIGHTTEXT_VISIBLE"] = false,
		["RIGHTTEXT_FRAME"] = "Ikarus_TargetTargetFrameManaBarRightText",
		["RIGHTTEXT_OFFSET_X"] = 1,
		["RIGHTTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["RIGHTTEXT_FONT"] = "Default",
		["RIGHTTEXT_FONTSIZE"] = 10,
		["RIGHTTEXT_COLORIZER"] = "NONE",
		["RIGHTTEXT_CONTENT"] = "",
		
		["OUTSIDE_LEFTTEXT_VISIBLE"] = false,
		["OUTSIDE_LEFTTEXT_FRAME"] = "Ikarus_TargetTargetFrameManaBarOutsideLeftText",
		["OUTSIDE_LEFTTEXT_OFFSET_X"] = 1,
		["OUTSIDE_LEFTTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["OUTSIDE_LEFTTEXT_FONT"] = "Default",
		["OUTSIDE_LEFTTEXT_FONTSIZE"] = 10,
		["OUTSIDE_LEFTTEX_COLORIZER"] = "NONE",
		["OUTSIDE_LEFTTEXT_CONTENT"] = "",
		
		["OUTSIDE_RIGHTTEXT_VISIBLE"] = true,
		["OUTSIDE_RIGHTTEXT_FRAME"] = "Ikarus_TargetTargetFrameManaBarOutsideRightText",
		["OUTSIDE_RIGHTTEXT_OFFSET_X"] = 1,
		["OUTSIDE_RIGHTTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["OUTSIDE_RIGHTTEXT_FONT"] = "Default",
		["OUTSIDE_RIGHTTEXT_FONTSIZE"] = 10,
		["OUTSIDE_RIGHTTEXT_COLORIZER"] = "NONE",
		["OUTSIDE_RIGHTTEXT_CONTENT"] = "[MANA_TYPE]"
	},
	
	["SKILLBAR"] = {
		["VISIBLE"] = true,
		["FRAME"] = "Ikarus_TargetTargetFrameSkillBar",
		["SYSTEM_COLOR"] = false,
		["OFFSET_X"] = 1,
		["OFFSET_Y"] = 1,
		["WEIGHT"] = 25,
		["TEXTURE"] = "Healbot",
		["COLORIZER"] = "NONE",
		["FOREGROUND_COLOR"] = { r = 0.3, g = 0.5, b = 0.85 },
		["BACKGROUND_COLOR"] = { r = 0.2, g = 0.4, b = 0.65 },
		
		["LEFTTEXT_VISIBLE"] = true,
		["LEFTTEXT_FRAME"] = "Ikarus_TargetTargetFrameSkillBarLeftText",
		["LEFTTEXT_OFFSET_X"] = 100,
		["LEFTTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["LEFTTEXT_FONT"] = "Default",
		["LEFTTEXT_FONTSIZE"] = 10,
		["LEFTTEXT_COLORIZER"] = "NONE",
		["LEFTTEXT_CONTENT"] = "[SP]",
		
		["RIGHTTEXT_VISIBLE"] = true,
		["RIGHTTEXT_FRAME"] = "Ikarus_TargetTargetFrameSkillBarRightText",
		["RIGHTTEXT_OFFSET_X"] = 1,
		["RIGHTTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["RIGHTTEXT_FONT"] = "Default",
		["RIGHTTEXT_FONTSIZE"] = 10,
		["RIGHTTEXT_COLORIZER"] = "NONE",
		["RIGHTTEXT_CONTENT"] = "[SKILL_TYPE]",
		
		["OUTSIDE_LEFTTEXT_VISIBLE"] = false,
		["OUTSIDE_LEFTTEXT_FRAME"] = "Ikarus_TargetTargetFrameSkillBarOutsideLeftText",
		["OUTSIDE_LEFTTEXT_OFFSET_X"] = 1,
		["OUTSIDE_LEFTTEXT_TEXTCOLOR"] = { r = 0.3, g = 0.5, b = 0.85 },
		["OUTSIDE_LEFTTEXT_FONT"] = "Default",
		["OUTSIDE_LEFTTEXT_FONTSIZE"] = 10,
		["OUTSIDE_LEFTTEXT_COLORIZER"] = "NONE",
		["OUTSIDE_LEFTTEXT_CONTENT"] = "",
		
		["OUTSIDE_RIGHTTEXT_VISIBLE"] = false,
		["OUTSIDE_RIGHTTEXT_FRAME"] = "Ikarus_TargetTargetFrameSkillBarOutsideRightText",
		["OUTSIDE_RIGHTTEXT_OFFSET_X"] = 1,
		["OUTSIDE_RIGHTTEXT_TEXTCOLOR"] = { r = 0.3, g = 0.5, b = 0.85 },
		["OUTSIDE_RIGHTTEXT_FONT"] = "Default",
		["OUTSIDE_RIGHTTEXT_FONTSIZE"] = 10,
		["OUTSIDE_RIGHTTEXT_COLORIZER"] = "NONE",
		["OUTSIDE_RIGHTTEXT_CONTENT"] = ""
	},
	
	["BUFFS"] = {
		["BUFFS_VISIBLE"] = false,
		["BUFFS_FRAME"] = "Ikarus_TargetTargetFrameBuffFrame",
		["BUFFS_SHOW_DURATION"] = true,
		["BUFFS_OFFSET_X"] = 0,
		["BUFFS_OFFSET_Y"] = 16,
		["BUFFS_SCALE"] = 1.0,
		["BUFFS_FONTSIZE"] = 14,
		["BUFFS_COLUMNS"] = 10,
		["BUFFS_SPACING"] = 4,
		["BUFFS_ALIGNMENT"] = "BOTTOM",
		
		["DEBUFFS_VISIBLE"] = false,
		["DEBUFFS_FRAME"] = "Ikarus_TargetTargetFrameDebuffFrame",
		["DEBUFFS_SHOW_DURATION"] = true,
		["DEBUFFS_OFFSET_X"] = 0,
		["DEBUFFS_OFFSET_Y"] = 10,
		["DEBUFFS_SCALE"] = 1.0,
		["DEBUFFS_FONTSIZE"] = 14,
		["DEBUFFS_COLUMNS"] = 10,
		["DEBUFFS_SPACING"] = 4,
		["DEBUFFS_ALIGNMENT"] = "RIGHT"
	},
	
	["PORTRAIT"] = {
		["VISIBLE"] = false,
		["FRAME"] = "Ikarus_TargetTargetFramePortraitFrame",
		["OFFSET_X"] = 1,
		["OFFSET_Y"] = 1,
		["WIDTH"] = 52,
		["HEIGHT"] = 52,
		["SCALE"] = 1.0,
		["ALIGNMENT"] = "LEFT",
	},
	
	["ICONS"] = {		
		["RAIDTARGET_VISIBLE"] = true,
		["RAIDTARGET_FRAME"] = "Ikarus_TargetTargetFrameIconsFrameRaidTargetIcon",
		["RAIDTARGET_OFFSET_X"] = 1,
		["RAIDTARGET_OFFSET_Y"] = 1,
		["RAIDTARGET_WIDTH"] = 32,
		["RAIDTARGET_HEIGHT"] = 32,
		["RAIDTARGET_SCALE"] = 1.0,
		["RAIDTARGET_ALIGNMENT"] = "RIGHT",
		
		["PVPSTATE_VISIBLE"] = false,
		["PVPSTATE_FRAME"] = "Ikarus_TargetTargetFrameIconsFramePVPStateIcon",
		["PVPSTATE_OFFSET_X"] = 1,
		["PVPSTATE_OFFSET_Y"] = 1,
		["PVPSTATE_WIDTH"] = 16,
		["PVPSTATE_HEIGHT"] = 16,
		["PVPSTATE_SCALE"] = 1.0,
		["PVPSTATE_ALIGNMENT"] = "TOP",
		
		["LOOTMASTER_VISIBLE"] = false,
		["LOOTMASTER_FRAME"] = "Ikarus_TargetTargetFrameIconsFrameLooterIcon",
		["LOOTMASTER_OFFSET_X"] = 15,
		["LOOTMASTER_OFFSET_Y"] = 1,
		["LOOTMASTER_WIDTH"] = 13,
		["LOOTMASTER_HEIGHT"] = 13,
		["LOOTMASTER_SCALE"] = 1.0,
		["LOOTMASTER_ALIGNMENT"] = "TOP",
		
		["RAIDLEADER_VISIBLE"] = false,
		["RAIDLEADER_FRAME"] = "Ikarus_TargetTargetFrameIconsFrameLeaderIcon",
		["RAIDLEADER_OFFSET_X"] = 1,
		["RAIDLEADER_OFFSET_Y"] = 1,
		["RAIDLEADER_WIDTH"] = 13,
		["RAIDLEADER_HEIGHT"] = 13,
		["RAIDLEADER_SCALE"] = 1.0,
		["RAIDLEADER_ALIGNMENT"] = "TOP",
		
		["BOSS_VISIBLE"] = false,
		["BOSS_FRAME"] = "Ikarus_TargetTargetFrameIconsFrameBossIcon",
		["BOSS_OFFSET_X"] = 1,
		["BOSS_OFFSET_Y"] = 1,
		["BOSS_WIDTH"] = 24,
		["BOSS_HEIGHT"] = 24,
		["BOSS_SCALE"] = 1.0,
		["BOSS_ALIGNMENT"] = "TOP",
		
		["MAINCLASS_VISIBLE"] = false,
		["MAINCLASS_FRAME"] = "Ikarus_TargetTargetFrameIconsFrameMainClassIcon",
		["MAINCLASS_OFFSET_X"] = 1,
		["MAINCLASS_OFFSET_Y"] = 1,
		["MAINCLASS_WIDTH"] = 20,
		["MAINCLASS_HEIGHT"] = 20,
		["MAINCLASS_SCALE"] = 1.0,
		["MAINCLASS_ALIGNMENT"] = "LEFT",
		
		["SUBCLASS_VISIBLE"] = false,
		["SUBCLASS_FRAME"] = "Ikarus_TargetTargetFrameIconsFrameSubClassIcon",
		["SUBCLASS_OFFSET_X"] = 1,
		["SUBCLASS_OFFSET_Y"] = 1,
		["SUBCLASS_WIDTH"] = 16,
		["SUBCLASS_HEIGHT"] = 16,
		["SUBCLASS_SCALE"] = 1.0,
		["SUBCLASS_ALIGNMENT"] = "LEFT"
	},
	
	["LABELS"] = {
		["TOPTEXT_VISIBLE"] = true,
		["TOPTEXT_FRAME"] = "Ikarus_TargetTargetFrameOutsideTopText",
		["TOPTEXT_OFFSET_X"] = 20,
		["TOPTEXT_OFFSET_Y"] = 1,
		["TOPTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["TOPTEXT_FONT"] = "Default",
		["TOPTEXT_FONTSIZE"] = 10,
		["TOPTEXT_COLORIZER"] = "RELATION",
		["TOPTEXT_CONTENT"] = "[NAME]",
		
		["RIGHTTEXT_VISIBLE"] = false,
		["RIGHTTEXT_FRAME"] = "Ikarus_TargetTargetFrameOutsideRightText",
		["RIGHTTEXT_OFFSET_X"] = 1,
		["RIGHTTEXT_OFFSET_Y"] = 1,
		["RIGHTTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["RIGHTTEXT_FONT"] = "Default",
		["RIGHTTEXT_FONTSIZE"] = 10,
		["RIGHTTEXT_COLORIZER"] = "NONE",
		["RIGHTTEXT_CONTENT"] = "",
		
		["BOTTOMTEXT_VISIBLE"] = true,
		["BOTTOMTEXT_FRAME"] = "Ikarus_TargetTargetFrameOutsideBottomText",
		["BOTTOMTEXT_OFFSET_X"] = 1,
		["BOTTOMTEXT_OFFSET_Y"] = 1,
		["BOTTOMTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["BOTTOMTEXT_FONT"] = "Default",
		["BOTTOMTEXT_FONTSIZE"] = 10,
		["BOTTOMTEXT_COLORIZER"] = "NONE",
		["BOTTOMTEXT_CONTENT"] = "[LVL]/[SLVL]",
		
		["LEFTTEXT_VISIBLE"] = false,
		["LEFTTEXT_FRAME"] = "Ikarus_TargetTargetFrameOutsideLeftText",
		["LEFTTEXT_OFFSET_X"] = 1,
		["LEFTTEXT_OFFSET_Y"] = 1,
		["LEFTTEXT_TEXTCOLOR"] = { r = 1.0, g = 1.0, b = 1.0 },
		["LEFTTEXT_FONT"] = "Default",
		["LEFTTEXT_FONTSIZE"] = 10,
		["LEFTTEXT_COLORIZER"] = "NONE",
		["LEFTTEXT_CONTENT"] = ""
	}
};

table.insert(ikarus.config.interface, 
	{
		"targettarget",
		
		--  General
		
		{
			"GENERAL", 
	        {"VISIBLE", nil,nil,"CHECKBOX", true},
	        {"USE_DEFAULT_FRAME", nil, nil,"CHECKBOX", true},
			{"DUMMY_STATE", nil, nil,"BUTTON", false}, 
			{"WOW_STYLE", nil, nil,"CHECKBOX"},
	        {"OFFSET_X", nil, nil,"SLIDER",false,0,"##interface.MAX_OFFSET_X"},
	        {"OFFSET_Y", nil, nil,"SLIDER",false,0,"##interface.MAX_OFFSET_Y"},
			{"WIDTH", nil, nil,"SLIDER",false,150,500},
			{"HEIGHT", nil, nil,"SLIDER",false,30,200},
	        {"ALPHA", nil, nil,"SLIDER", false, 0.0,1.0, 1.0},
	        {"NUMBER_FORMAT", nil, nil,"COMBOBOX", false, "##interface.NUMBER_FORMATS", true},
	        {"FRAME_LOCKED", nil, nil,"CHECKBOX"},
	        {"SCALE", nil, nil,"SLIDER",false,0.5,2.0}
		},
		
		--  Docking
		
		{
			"DOCKING", 
	        {"ENABLE", nil,nil,"CHECKBOX", false},
	        {"TARGET", nil, nil,"COMBOBOX", false, {"PLAYER","TARGET"}, true},
	        {"OFFSET_X", nil, nil,"SLIDER",false,-500,500},
	        {"OFFSET_Y", nil, nil,"SLIDER",false,-500,500},
	        {"ALIGNMENT", nil,nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true},
		},
		
		--  Healthbar
		
		{	
			"HEALTHBAR",
			"GENERAL",
			{"VISIBLE", nil,nil,"CHECKBOX", true},
	        {"CLASS_COLOR", nil,nil,"CHECKBOX"},
			{"WEIGHT", nil,nil,"SLIDER",false,20,100,1,"LOW", "HIGH"},
			{"TEXTURE", nil,nil,"COMBOBOX",true,"##interface.BAR_TEXTURES"},
			{"COLORIZER", nil,nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"FOREGROUND_COLOR", nil,nil,"COLORPICKER"},
			{"BACKGROUND_COLOR", nil,nil,"COLORPICKER"},
			
			"LEFTTEXT",
			{"LEFTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", true},
			{"LEFTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"LEFTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"LEFTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"LEFTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"LEFTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"LEFTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,0,"$$Ikarus_TargetTargetFrame.GetWidth"},
			
			"RIGHTTEXT",
			{"RIGHTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", false},
			{"RIGHTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"RIGHTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"RIGHTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"RIGHTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"RIGHTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"RIGHTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth", 0},
			
			"OUTSIDE_LEFTTEXT",
			{"OUTSIDE_LEFTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", false},
			{"OUTSIDE_LEFTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"OUTSIDE_LEFTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"OUTSIDE_LEFTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"OUTSIDE_LEFTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"OUTSIDE_LEFTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"OUTSIDE_LEFTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth", 0},
			
			"OUTSIDE_RIGHTTEXT",
			{"OUTSIDE_RIGHTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", false},
			{"OUTSIDE_RIGHTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"OUTSIDE_RIGHTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"OUTSIDE_RIGHTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"OUTSIDE_RIGHTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"OUTSIDE_RIGHTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"OUTSIDE_RIGHTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,0,"$$Ikarus_TargetTargetFrame.GetWidth"},
		},
		
		--  Manabar
		
		{	
			"MANABAR",
			"GENERAL",
			{"VISIBLE", nil,nil,"CHECKBOX", true},
	        {"SYSTEM_COLOR", nil,nil,"CHECKBOX"},
			{"WEIGHT", nil,nil,"SLIDER",false,20,100, 1,"LOW", "HIGH"},
			{"TEXTURE", nil,nil,"COMBOBOX",true,"##interface.BAR_TEXTURES"},
			{"COLORIZER", nil,nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"FOREGROUND_COLOR", nil,nil,"COLORPICKER"},
			{"BACKGROUND_COLOR", nil,nil,"COLORPICKER"},
			
			"LEFTTEXT",
			{"LEFTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", true},
			{"LEFTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"LEFTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"LEFTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"LEFTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"LEFTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"LEFTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,0,"$$Ikarus_TargetTargetFrame.GetWidth"},
			
			"RIGHTTEXT",
			{"RIGHTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", false},
			{"RIGHTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"RIGHTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"RIGHTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"RIGHTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"RIGHTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"RIGHTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth", 0},
			
			"OUTSIDE_LEFTTEXT",
			{"OUTSIDE_LEFTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", false},
			{"OUTSIDE_LEFTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"OUTSIDE_LEFTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"OUTSIDE_LEFTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"OUTSIDE_LEFTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"OUTSIDE_LEFTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"OUTSIDE_LEFTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth",0},
			
			"OUTSIDE_RIGHTTEXT",
			{"OUTSIDE_RIGHTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", false},
			{"OUTSIDE_RIGHTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"OUTSIDE_RIGHTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"OUTSIDE_RIGHTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"OUTSIDE_RIGHTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"OUTSIDE_RIGHTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"OUTSIDE_RIGHTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,0,"$$Ikarus_TargetTargetFrame.GetWidth"},
		},
		
		--  Skillbar
		
		{	
			"SKILLBAR",
			"GENERAL",
			{"VISIBLE", nil,nil,"CHECKBOX", true},
	        {"SYSTEM_COLOR", nil,nil,"CHECKBOX"},
			{"WEIGHT", nil,nil,"SLIDER",false,20,100,1,"LOW", "HIGH"},
			{"TEXTURE", nil,nil,"COMBOBOX",true,"##interface.BAR_TEXTURES"},
			{"COLORIZER", nil,nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"FOREGROUND_COLOR", nil,nil,"COLORPICKER"},
			{"BACKGROUND_COLOR", nil,nil,"COLORPICKER"},
			
			"LEFTTEXT",
			{"LEFTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", true},
			{"LEFTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"LEFTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"LEFTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"LEFTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"LEFTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"LEFTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,0,"$$Ikarus_TargetTargetFrame.GetWidth"},
			
			"RIGHTTEXT",
			{"RIGHTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", false},
			{"RIGHTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"RIGHTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"RIGHTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"RIGHTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"RIGHTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"RIGHTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth",0},
			
			"OUTSIDE_LEFTTEXT",
			{"OUTSIDE_LEFTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", false},
			{"OUTSIDE_LEFTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"OUTSIDE_LEFTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"OUTSIDE_LEFTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"OUTSIDE_LEFTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"OUTSIDE_LEFTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"OUTSIDE_LEFTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth",0},
			
			"OUTSIDE_RIGHTTEXT",
			{"OUTSIDE_RIGHTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", false},
			{"OUTSIDE_RIGHTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"OUTSIDE_RIGHTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"OUTSIDE_RIGHTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"OUTSIDE_RIGHTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"OUTSIDE_RIGHTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"OUTSIDE_RIGHTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,0,"$$Ikarus_TargetTargetFrame.GetWidth"},
		},
		
		--  Buffs
		
		{
			"BUFFS",
			"BUFFS",
			{"BUFFS_VISIBLE", "VISIBLE",nil,"CHECKBOX"},
			{"BUFFS_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth","$$Ikarus_TargetTargetFrame.GetWidth"},
			{"BUFFS_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetHeight","$$Ikarus_TargetTargetFrame.GetHeight"},
			{"BUFFS_SCALE", "SCALE",nil,"SLIDER",false,0.5,2.0},
			{"BUFFS_SHOW_DURATION", "SHOW_DURATION",nil,"CHECKBOX"},
			{"BUFFS_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"BUFFS_COLUMNS", "COLUMNS",nil,"SLIDER",false,4,20},
			{"BUFFS_SPACING", "SPACING",nil,"SLIDER",false,0,10},
			{"BUFFS_ALIGNMENT", "ALIGNMENT",nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true},
			"DEBUFFS",
			{"DEBUFFS_VISIBLE", "VISIBLE",nil,"CHECKBOX"},
			{"DEBUFFS_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth","$$Ikarus_TargetTargetFrame.GetWidth"},
			{"DEBUFFS_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetHeight","$$Ikarus_TargetTargetFrame.GetHeight"},
			{"DEBUFFS_SCALE", "SCALE",nil,"SLIDER",false,0.5,2.0},
			{"DEBUFFS_SHOW_DURATION", "SHOW_DURATION",nil,"CHECKBOX"},
			{"DEBUFFS_COLUMNS", "COLUMNS",nil,"SLIDER",false,4,20},
			{"DEBUFFS_SPACING", "SPACING",nil,"SLIDER",false,0,10},
			{"DEBUFFS_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"DEBUFFS_ALIGNMENT", "ALIGNMENT",nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true}	
		},
		
		--	Portrait
		
		{
			"PORTRAIT",
			{"VISIBLE", nil,nil,"CHECKBOX"},
			{"OFFSET_X", nil,nil,"SLIDER",false,-100,"$$Ikarus_TargetTargetFrame.GetWidth"},
			{"OFFSET_Y", nil,nil,"SLIDER",false,-100,"$$Ikarus_TargetTargetFrame.GetHeight"},
			{"SCALE", nil,nil,"SLIDER",false,0.5,2.0},
			{"ALIGNMENT", nil,nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true},
		},
		
		--	Icons
		
		{
			"ICONS",
			"RAIDTARGET",
			{"RAIDTARGET_VISIBLE", "VISIBLE",nil,"CHECKBOX"},
			{"RAIDTARGET_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth","$$Ikarus_TargetTargetFrame.GetWidth"},
			{"RAIDTARGET_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetHeight","$$Ikarus_TargetTargetFrame.GetHeight"},
			{"RAIDTARGET_SCALE", "SCALE",nil,"SLIDER",false,0.5,2.0},
			{"RAIDTARGET_ALIGNMENT", "ALIGNMENT",nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true},
			"PVPSTATE",
			{"PVPSTATE_VISIBLE", "VISIBLE",nil,"CHECKBOX"},
			{"PVPSTATE_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth","$$Ikarus_TargetTargetFrame.GetWidth"},
			{"PVPSTATE_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetHeight","$$Ikarus_TargetTargetFrame.GetHeight"},
			{"PVPSTATE_SCALE", "SCALE",nil,"SLIDER",false,0.5,2.0},
			{"PVPSTATE_ALIGNMENT", "ALIGNMENT",nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true},
			"LOOTMASTER",
			{"LOOTMASTER_VISIBLE", "VISIBLE",nil,"CHECKBOX"},
			{"LOOTMASTER_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth","$$Ikarus_TargetTargetFrame.GetWidth"},
			{"LOOTMASTER_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetHeight","$$Ikarus_TargetTargetFrame.GetHeight"},
			{"LOOTMASTER_SCALE", "SCALE",nil,"SLIDER",false,0.5,2.0},
			{"LOOTMASTER_ALIGNMENT", "ALIGNMENT",nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true},
			"RAIDLEADER",
			{"RAIDLEADER_VISIBLE", "VISIBLE",nil,"CHECKBOX"},
			{"RAIDLEADER_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth","$$Ikarus_TargetTargetFrame.GetWidth"},
			{"RAIDLEADER_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetHeight","$$Ikarus_TargetTargetFrame.GetHeight"},
			{"RAIDLEADER_SCALE", "SCALE",nil,"SLIDER",false,0.5,2.0},
			{"RAIDLEADER_ALIGNMENT", "ALIGNMENT",nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true},
			"BOSS",
			{"BOSS_VISIBLE", "VISIBLE",nil,"CHECKBOX"},
			{"BOSS_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth","$$Ikarus_TargetTargetFrame.GetWidth"},
			{"BOSS_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetHeight","$$Ikarus_TargetTargetFrame.GetHeight"},
			{"BOSS_SCALE", "SCALE",nil,"SLIDER",false,0.5,2.0},
			{"BOSS_ALIGNMENT", "ALIGNMENT",nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true},
			"MAINCLASS",
			{"MAINCLASS_VISIBLE", "VISIBLE",nil,"CHECKBOX"},
			{"MAINCLASS_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth","$$Ikarus_TargetTargetFrame.GetWidth"},
			{"MAINCLASS_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetHeight","$$Ikarus_TargetTargetFrame.GetHeight"},
			{"MAINCLASS_SCALE", "SCALE",nil,"SLIDER",false,0.5,2.0},
			{"MAINCLASS_ALIGNMENT", "ALIGNMENT",nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true},
			"SUBCLASS",
			{"SUBCLASS_VISIBLE", "VISIBLE",nil,"CHECKBOX"},
			{"SUBCLASS_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetWidth","$$Ikarus_TargetTargetFrame.GetWidth"},
			{"SUBCLASS_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,"$$Ikarus_TargetTargetFrame.GetHeight","$$Ikarus_TargetTargetFrame.GetHeight"},
			{"SUBCLASS_SCALE", "SCALE",nil,"SLIDER",false,0.5,2.0},
			{"SUBCLASS_ALIGNMENT", "ALIGNMENT",nil,"COMBOBOX",false,"##interface.ALIGNMENTS", true}
		},
		
		--	Labels
		
		{
			"LABELS",
			"TOPTEXT",
			{"TOPTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", true},
			{"TOPTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"TOPTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"TOPTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"TOPTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"TOPTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"TOPTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,0,"$$Ikarus_TargetTargetFrame.GetWidth"},
			{"TOPTEXT_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,-100,0},
			"RIGHTTEXT",
			{"RIGHTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", true},
			{"RIGHTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"RIGHTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"RIGHTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"RIGHTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"RIGHTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"RIGHTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,0,100},
			{"RIGHTTEXT_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,0,"$$Ikarus_TargetTargetFrame.GetHeight"},
			"BOTTOMTEXT",
			{"BOTTOMTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", true},
			{"BOTTOMTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"BOTTOMTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"BOTTOMTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"BOTTOMTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"BOTTOMTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"BOTTOMTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,0,"$$Ikarus_TargetTargetFrame.GetWidth"},
			{"BOTTOMTEXT_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,0,100},
			"LEFTTEXT",
			{"LEFTTEXT_VISIBLE", "VISIBLE",nil,"CHECKBOX", true},
			{"LEFTTEXT_TEXTCOLOR", "TEXT_COLOR",nil,"COLORPICKER"},
			{"LEFTTEXT_FONT", "FONT",nil,"COMBOBOX",true,"##interface.FONTS"},
			{"LEFTTEXT_FONTSIZE", "FONT_SIZE",nil,"SLIDER",false,"##interface.MIN_FONT_SIZE","##interface.MAX_FONT_SIZE"},
			{"LEFTTEXT_CONTENT", "CONTENT",nil,"TEXTFIELD"},
			{"LEFTTEXT_COLORIZER", "COLORIZER",nil,"COMBOBOX",true,"##interface.COLORIZERS", true},
			{"LEFTTEXT_OFFSET_X", "OFFSET_X",nil,"SLIDER",false,-100,0},
			{"LEFTTEXT_OFFSET_Y", "OFFSET_Y",nil,"SLIDER",false,0,"$$Ikarus_TargetTargetFrame.GetHeight"}
		}
    }
);

	
--  ***********************************************************************
--  class handling target unit frame behavior
ikarus.delegates.TargetTargetUnitDelegateClass = ikarus:NewClass(ikarus.delegates.BasicUnitDelegateClass);

function ikarus.delegates.TargetTargetUnitDelegateClass:Init()
	self.unit = "targettarget";
	self.frame = getglobal(ikarus.config.defaults.targettarget.GENERAL.FRAME);
	self.defaultFrame = getglobal(ikarus.config.defaults.targettarget.GENERAL.DEFAULT_FRAME);
	self.eventList = {
		["UNIT_LEVEL"] 				= ikarus.delegates.TargetTargetUnitDelegateClass.UpdateAll;
		["UNIT_CLASS_CHANGED"] 		= ikarus.delegates.TargetTargetUnitDelegateClass.UpdateAll;
		["UNIT_HEALTH"] 			= ikarus.delegates.BasicUnitDelegateClass.UpdateHealth; 
		["UNIT_MAXHEALTH"] 			= ikarus.delegates.BasicUnitDelegateClass.UpdateHealth; 
		["UNIT_MANA"] 				= ikarus.delegates.BasicUnitDelegateClass.UpdateMana; 
		["UNIT_MAXMANA"] 			= ikarus.delegates.BasicUnitDelegateClass.UpdateMana; 
		["UNIT_SKILL"] 				= ikarus.delegates.BasicUnitDelegateClass.UpdateSkill; 
		["UNIT_MAXSKILL"] 			= ikarus.delegates.BasicUnitDelegateClass.UpdateSkill; 
		["UNIT_BUFF_CHANGED"] 		= ikarus.delegates.BasicUnitDelegateClass.UpdateBuffs; 
		["RAID_TARGET_CHANGED"] 	= ikarus.delegates.BasicUnitDelegateClass.UpdateRaidTargetIcon; 
		["PARTY_LEADER_CHANGED"] 	= ikarus.delegates.BasicUnitDelegateClass.UpdatePartyLeaderIcon;
		["UNIT_TARGET_CHANGED"] 	= ikarus.delegates.TargetTargetUnitDelegateClass.UpdateAll;
	};
end;

function ikarus.delegates.TargetTargetUnitDelegateClass:OnEvent(event, unit)
    if(unit and UnitIsUnit(unit, self.unit) and self.frame:IsVisible())then       
        if(event == "UNIT_LEVEL" or event == "UNIT_CLASS_CHANGED")then
            self:UpdateAll();
        elseif(event == "UNIT_HEALTH" or event == "UNIT_MAXHEALTH")then
            self:UpdateHealth(self);
			self:UpdateText(self);
        elseif(event == "UNIT_MANA" or event == "UNIT_MAXMANA")then
            self:UpdateMana(self);
			self:UpdateText(self);
        elseif(event == "UNIT_SKILL" or event == "UNIT_MAXSKILL")then
            self:UpdateSkill(self);
			self:UpdateText(self);
        elseif(event == "UNIT_BUFF_CHANGED")then
			self:UpdateBuffs(self);
			self:UpdateText(self);
        end;
    end;
	
    if(event == "UNIT_TARGET_CHANGED")then
        self:UpdateAll(true);
    elseif(event == "RAID_TARGET_CHANGED" and self.frame:IsVisible())then
        self:UpdateRaidTargetIcon(self);
		self:UpdateText(self);
    elseif(event == "PARTY_LEADER_CHANGED" and self.frame:IsVisible())then
        self:UpdatePartyLeaderIcon(self);
		self:UpdateText(self);
    end;
end;

function ikarus.delegates.TargetTargetUnitDelegateClass:OnScriptEvent(event, frame, key, ...)
    if(event == "OnClick" and key == "RBUTTON")then
		ToggleDropDownMenu(TargetFrameDropDown, 1, nil, self.frame:GetName());
    else
		self:SuperClass():OnScriptEvent(self, event, frame, key, ...);
    end;
end;

function ikarus.delegates.TargetTargetUnitDelegateClass:HideDefaultFrame()
	TargetTargetFrame:UnregisterEvent("UNIT_TARGET_CHANGED");
	TargetTargetFrame:UnregisterEvent("UNIT_BUFF_CHANGED");
	TargetTargetFrame:UnregisterEvent("UNIT_CLASS_CHANGED");
	TargetTargetFrame:UnregisterEvent("UNIT_NAME_UPDATE");
	TargetTargetFrame:UnregisterEvent("UNIT_LEVEL");
	TargetTargetFrame:UnregisterEvent("UNIT_PORTRAIT_UPDATE");
	TargetTargetFrame:UnregisterEvent("RAID_TARGET_CHANGED");
	TargetTargetFrame:UnregisterEvent("UNIT_RELATION");
	TargetTargetFrame.healthBar:UnregisterEvent("UNIT_HEALTH");
	TargetTargetFrame.healthBar:UnregisterEvent("UNIT_MAXHEALTH");
	TargetTargetFrame.manaBar:UnregisterEvent("UNIT_MANA");
	TargetTargetFrame.manaBar:UnregisterEvent("UNIT_MAXMANA");
	TargetTargetFrame.skillBar:UnregisterEvent("UNIT_SKILL");
	TargetTargetFrame.skillBar:UnregisterEvent("UNIT_MAXSKILL");
	TargetTargetFrame:Hide();
end;

function ikarus.delegates.TargetTargetUnitDelegateClass:ShowDefaultFrame()	
	TargetTargetFrame:RegisterEvent("UNIT_TARGET_CHANGED");
	TargetTargetFrame:RegisterEvent("UNIT_BUFF_CHANGED");
	TargetTargetFrame:RegisterEvent("UNIT_CLASS_CHANGED");
	TargetTargetFrame:RegisterEvent("UNIT_NAME_UPDATE");
	TargetTargetFrame:RegisterEvent("UNIT_LEVEL");
	TargetTargetFrame:RegisterEvent("UNIT_PORTRAIT_UPDATE");
	TargetTargetFrame:RegisterEvent("RAID_TARGET_CHANGED");
	TargetTargetFrame:RegisterEvent("UNIT_RELATION");
	TargetTargetFrame.healthBar:RegisterEvent("UNIT_HEALTH");
	TargetTargetFrame.healthBar:RegisterEvent("UNIT_MAXHEALTH");
	TargetTargetFrame.manaBar:RegisterEvent("UNIT_MANA");
	TargetTargetFrame.manaBar:RegisterEvent("UNIT_MAXMANA");
	TargetTargetFrame.skillBar:RegisterEvent("UNIT_SKILL");
	TargetTargetFrame.skillBar:RegisterEvent("UNIT_MAXSKILL");
	--Let RoM do this
	--TargetTargetFrame:Show();
end;

function ikarus.delegates.TargetTargetUnitDelegateClass:UpdateAll(forward)
	self:SuperClass():UpdateAll(self);
	
	if(forward) then
		local delegate = ikarus:GetDelegate("targettargettarget");
		if(delegate and delegate:IsEnabled() and delegate:Profile().GENERAL.VISIBLE) then
			delegate:UpdateAll(true);
		end;
	end;
end;

--  Loads stuff like textures and other layout information from the profile
function ikarus.delegates.TargetTargetUnitDelegateClass:LoadConfig()
    if(ikarus.config:IsLoaded()) then
		self:SuperClass():LoadConfig(self);
		self:SuperClass():LoadBoundProperties(self);
		self:UpdateAll(false);
    end;
end;

function ikarus.delegates.TargetTargetUnitDelegateClass:LoadBoundProperties()
	if(ikarus.config:IsLoaded()) then
		self:SuperClass():LoadBoundProperties(self);
		self:UpdateAll(false);
    end;
end;
--  ***********************************************************************

--  Instantiate our delegate 
return ikarus.delegates.TargetTargetUnitDelegateClass:Create();
	
end;